﻿@{
    ViewBag.Title = Local("Route.PageTitle");
    Layout = GetPath(SystemDirectory.Shared, "_Dialog.cshtml");
}

@model Mozlite.Common.Route
    
@if (IsValided)
{ 
    using (Html.BeginForm())
    {
    <div class="box">
        <label>@Local("Route.Key")</label>
        <div class="right">
            <input type="text" name="Key" value="@Model.Key" />
            <div class="summary">@Local("Route.Key.Summary")</div>
        </div>
    </div>

    <div class="box">
        <label>@Local("Route.AreaName")</label>
        <div class="right">
            @Html.DropdownListForArea(model=>model.AreaName)
            <div class="summary">@Local("Route.AreaName.Summary", Routes.NullArea)</div>
        </div>
    </div>

    <div class="box">
        <label>@Local("Route.Url")</label>
        <div class="right winput">
            <input type="text" name="Url" value="@Model.Url" />
            <div class="summary">@Local("Route.Url.Summary")</div>
        </div>
    </div>

    <div class="box">
        <h3>@Local("Route.Defaults")</h3>
        <textarea name="Defaults" style="height:50px;" @CPHelper.SetReadOnly(Model.RouteID > 0)>@Model.Defaults</textarea>
    </div>

    <div class="box">
        <h3>@Local("Route.Constraints")</h3>
        <textarea name="Constraints" @CPHelper.SetReadOnly(Model.RouteID > 0)>@Model.Constraints</textarea>
        <div class="summary">@Local("Route.Constraints.Summary")</div>
    </div>

    <div class="box">
        <label>@Local("Route.RouteHandlerString")</label>
        <div class="right winput">
            <input type="text" name="RouteHandlerString" value="@Model.RouteHandlerString" @CPHelper.SetReadOnly(Model.RouteID > 0)/>
        </div>
    </div>

    <div class="box">
        <button class="submit">@Local("Route.Save")</button>
    </div>
    }
}